package com.xkcoding.mq.kafka.controller;

import com.xkcoding.mq.kafka.constants.KafkaConsts;
import com.xkcoding.mq.kafka.handler.SyncDataHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SendMsgController {
    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;

    @Autowired
    SyncDataHandler syncDataHandler;


    @GetMapping("/syncMsg")
    public void testSendMsg() throws InterruptedException {
        syncDataHandler.testSend();
    }

    @GetMapping("/sendData")
    public void sendMsg() throws InterruptedException {
        syncDataHandler.sendData();
    }

}

